::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceLine {
    name           {type string minOccurs 0 maxOccurs 1}
    description    {type string minOccurs 0 maxOccurs 1}
    unit_cost      {type string minOccurs 0 maxOccurs 1}
    quantity       {type string minOccurs 0 maxOccurs 1}
    tax1_name      {type string minOccurs 0 maxOccurs 1}
    tax2_name      {type string minOccurs 0 maxOccurs 1}
    tax1_percent   {type string minOccurs 0 maxOccurs 1}
    tax2_percent   {type string minOccurs 0 maxOccurs 1}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceLineArray {
    line    {type InvoiceLine()}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceDetailLine {
    amount         {type string minOccurs 0 maxOccurs 1}
    name           {type string minOccurs 0 maxOccurs 1}
    description    {type string minOccurs 0 maxOccurs 1}
    unit_cost      {type string minOccurs 0 maxOccurs 1}
    quantity       {type string minOccurs 0 maxOccurs 1}
    tax1_name      {type string minOccurs 0 maxOccurs 1}
    tax2_name      {type string minOccurs 0 maxOccurs 1}
    tax1_percent   {type string minOccurs 0 maxOccurs 1}
    tax2_percent   {type string minOccurs 0 maxOccurs 1}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceLineDetailArray {
    line    {type InvoiceDetailLine()}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceDefinition {
    client_id       {type string minOccurs 0 maxOccurs 1}
    number          {type string minOccurs 0 maxOccurs 1}
    status          {type string minOccurs 0 maxOccurs 1}
    date            {type string minOccurs 0 maxOccurs 1}
    po_number       {type string minOccurs 0 maxOccurs 1}
    discount        {type string minOccurs 0 maxOccurs 1}
    notes           {type string minOccurs 0 maxOccurs 1}
    terms           {type string minOccurs 0 maxOccurs 1}
    first_name      {type string minOccurs 0 maxOccurs 1}
    last_name       {type string minOccurs 0 maxOccurs 1}
    organization    {type string minOccurs 0 maxOccurs 1}
    p_street1       {type string minOccurs 0 maxOccurs 1}
    p_street2       {type string minOccurs 0 maxOccurs 1}
    p_city          {type string minOccurs 0 maxOccurs 1}
    p_state         {type string minOccurs 0 maxOccurs 1}
    p_country       {type string minOccurs 0 maxOccurs 1}
    p_code          {type string minOccurs 0 maxOccurs 1}
    vat_name        {type string minOccurs 0 maxOccurs 1}
    vat_number      {type string minOccurs 0 maxOccurs 1}
    lines           {type InvoiceLineDetailArray minOccurs 0 maxOccurs 1}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceUpdate {
    invoice_id {type string minOccurs 1 maxOccurs 1}
    client_id       {type string minOccurs 0 maxOccurs 1}
    status          {type string minOccurs 0 maxOccurs 1}
    date            {type string minOccurs 0 maxOccurs 1}
    po_number       {type string minOccurs 0 maxOccurs 1}
    discount        {type string minOccurs 0 maxOccurs 1}
    notes           {type string minOccurs 0 maxOccurs 1}
    terms           {type string minOccurs 0 maxOccurs 1}
    first_name      {type string minOccurs 0 maxOccurs 1}
    last_name       {type string minOccurs 0 maxOccurs 1}
    organization    {type string minOccurs 0 maxOccurs 1}
    p_street1       {type string minOccurs 0 maxOccurs 1}
    p_street2       {type string minOccurs 0 maxOccurs 1}
    p_city          {type string minOccurs 0 maxOccurs 1}
    p_state         {type string minOccurs 0 maxOccurs 1}
    p_country       {type string minOccurs 0 maxOccurs 1}
    p_code          {type string minOccurs 0 maxOccurs 1}
    vat_name        {type string minOccurs 0 maxOccurs 1}
    vat_number      {type string minOccurs 0 maxOccurs 1}
    lines           {type InvoiceLineArray}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceDetail {
    invoice_id          {type string minOccurs 1 maxOccurs 1}
    number              {type string minOccurs 0 maxOccurs 1}
    links               {type InvoiceLink()}
    client_id           {type string minOccurs 0 maxOccurs 1}
    status              {type string minOccurs 0 maxOccurs 1}
    date                {type string minOccurs 0 maxOccurs 1}
    amount              {type string minOccurs 0 maxOccurs 1}
    amount_outstanding  {type string minOccurs 0 maxOccurs 1}
    organization        {type string minOccurs 0 maxOccurs 1}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceLink {
    client_view {type string minOccurs 0 maxOccurs 1}
    view        {type string minOccurs 0 maxOccurs 1}
}

::WS::Utils::ServiceTypeDef Client FreshBookApi InvoiceListArray {
    invoice    {type InvoiceDetail()}
}


::WS::Client::DefineRestMethod FreshBookApi invoice invoice.create {
    invoice    {type InvoiceDefinition}
} {
    invoice_id {type string}
}

::WS::Client::DefineRestMethod FreshBookApi invoice invoice.update {
    invoice    {type InvoiceUpdate}
} {}

::WS::Client::DefineRestMethod FreshBookApi invoice invoice.get {
    invoice_id {type string}
} {
    invoice    {type InvoiceDefinition}
}

::WS::Client::DefineRestMethod FreshBookApi invoice invoice.delete {
    invoice_id {type string}
} {}

::WS::Client::DefineRestMethod FreshBookApi invoice invoice.list {
    client_id       {type string minOccurs 0 maxOccurs 1}
    recurring_id    {type string minOccurs 0 maxOccurs 1}
    status          {type string minOccurs 0 maxOccurs 1}
    date_from       {type string minOccurs 0 maxOccurs 1}
    date_to         {type string minOccurs 0 maxOccurs 1}
    page            {type integer minOccurs 0 maxOccurs 1}
    per_page        {type integer minOccurs 0 maxOccurs 1}
} {
    invoices    {type InvoiceListArray}
}

::WS::Client::DefineRestMethod FreshBookApi invoice invoice.sendByEmail {
    invoice_id {type string}
} {
}

::WS::Client::DefineRestMethod FreshBookApi invoice invoice.SnailMail {
    invoice_id {type string}
} {
}
